package cn.enilu.flash.bean.entity.cust;

import cn.enilu.flash.bean.entity.BaseEntity;
import lombok.Data;
import org.hibernate.annotations.Table;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * @Description
 * @Author Spark
 * @Date Created in (2019/11/04 13:31)
 * @Version v1.0
 * @Modify
 **/
@Entity(name="cust_house_ref")
@Table(appliesTo = "cust_house_ref",comment = "客户房间关联")
@Data
@EntityListeners(AuditingEntityListener.class)
public class CustHouseRef implements Serializable {
    @Id
    @GeneratedValue
    private Long id;

    @Column(name = "community_id", columnDefinition = "BIGINT COMMENT '社区'")
    @NotNull(message = "社区不能为空")
    private Long communityId;

    @Column(name = "building_id", columnDefinition = "BIGINT COMMENT '大楼'")
    @NotNull(message = "大楼不能为空")
    private Long buildingId;

    @Column(name = "room_id", columnDefinition = "BIGINT COMMENT '房间'")
    @NotNull(message = "房间不能为空")
    private Long roomId;

    @Column(name = "cust_id", columnDefinition = "BIGINT COMMENT '客户'")
    @NotNull(message = "客户不能为空")
    private Long custId;

    @Column(name = "cust_name", columnDefinition = "VARCHAR(128) COMMENT '客户名称'")
    private String custName;
}
